using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;

namespace Stormwind.Testing.Entities {
	/// <summary>
	/// Customer object for unit testing purposes.
	/// </summary>
	[ActiveRecord]
	public class Customer {

		private int id;
		private string name;
		private IList<OrderItem> orders = new List<OrderItem>();

		/// <summary>
		/// Id of the customer.
		/// </summary>
		[PrimaryKey(PrimaryKeyType.Native)]
		public int Id {
			get { return id; }
			set { id = value; }
		}

		/// <summary>
		/// Name of the customer.
		/// </summary>
		[Property]
		public string Name {
			get { return name; }
			set { name = value; }
		}

		/// <summary>
		/// List of orders of this customer.
		/// </summary>
		[HasMany(typeof(OrderItem), Lazy = true, Cascade = ManyRelationCascadeEnum.SaveUpdate)]
		public virtual IList<OrderItem> Orders {
			get { return orders; }
			set { orders = value; }
		}

	}
}
